﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using University.Workshop.Business;

namespace University.Workshop.Presenters.Expenses.Read
{
    public class  PresenterReadExpense
    {
        IReadExpenseView view;
        Model.Expense expenseToRead = new Model.Expense();

        public PresenterReadExpense(IReadExpenseView view, Model.Expense ex)
        {
            this.view = view;
            this.expenseToRead = ex;
            UpdateViewData();
        }

        public void UpdateViewData()
        {
            view.Amount = expenseToRead.Amount;
            view.Description = expenseToRead.Description;
            view.Item = expenseToRead.ExpenseType;
            view.Price = expenseToRead.Price;
            view.Receipt = expenseToRead.Receipt;
            view.SpendDate = expenseToRead.SpendDate;
        }
    }
}
